<template>
    <img alt="Vue logo" src="./assets/logo.png" />
    <el-button @click="changeLang">click</el-button>
    {{$t('el').image.error}}
    <br /><children />
    <el-tag type="success">标签二</el-tag>
</template>

<script>
import { defineComponent } from 'vue';
// import { useStore } from 'vuex';
import { Translator } from '@/vender';
import Children from '@/component/Children';

export default defineComponent({
    created() {
        Translator.mergeVue(this.$store.state);
        // Translate.mergeVue(this.$data);
    },
    components: {
        Children
    },
    data() {
        return {
            obj: {
                a: {
                    b: 123
                }
            }
        };
    },
    methods: {
        changeLang() {
            const newLang = this.$store.state.$lang === 'zh' ? 'en' : 'zh';
            this.$store.state.$lang = newLang;
        }
    },
    mounted() {
    }
});
</script>
